package kr.hkit.powerjava.chapter26;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;
import java.net.Socket;
import java.net.URL;
import java.net.URLConnection;

public class URLPostTest {
	public static void main(String[] args) {
		//http://www.hkit.kr/SUB/?ctId=22
		try {
			URL url= new URL("http://www.hkit.kr/SUB/");
			URLConnection connection= url.openConnection();
			connection.setDoOutput(true);
			
			OutputStreamWriter out= new OutputStreamWriter(connection.getOutputStream());
			out.write("ctId="+22);
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
